//插入表
//参数1 数据库指针
//参数2 表名 
//参数3 插入的信息 Usermsg; data
//返回值：插入成功返回0，失败返回-1
#include"../include/p.h"
int insert_mydb(sqlite3 *mydb,const char *tbname ,Mymod newmod)
{
	char sql[100]="insert into usermsg values(1000,'zhangsan','123')";
	sprintf(sql,"insert into %s values(%d,'%s','%s')",tbname,newmod.modid,newmod.modname,newmod.property);
	printf("%s\n",sql);
	char *errmsg=NULL;
	int ret=sqlite3_exec(mydb,sql,NULL,NULL,&errmsg);
	if(ret!=SQLITE_OK)
	{
		printf("insert error \n");
		return -1;
	}
	printf("insert ok \n");
	return 0;
}
